package com.zhejiangzhengyuan.municipal_common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhejiangzhengyuan.municipal_common.entity.Case;
import com.zhejiangzhengyuan.municipal_common.entity.Device;
import com.zhejiangzhengyuan.municipal_common.entity.vo.AcceptTestDdetails;
import com.zhejiangzhengyuan.municipal_common.entity.vo.CaseNoHandle;
import com.zhejiangzhengyuan.municipal_common.entity.vo.DeviceVo;
import com.zhejiangzhengyuan.municipal_common.entity.vo.OneWayCaseNoHandVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 案件表，案件是对事件来源数据以及相应处理过程和结果的包裹数据 Mapper 接口
 * </p>
 *
 * @author linju
 * @since 2019-11-22
 */
@Repository
public interface CaseMapper extends BaseMapper<Case> {

    int insertCase(@Param("case") Case C);

    @Select("SELECT *  FROM \"case\" ca WHERE ca.\"id\"=#{cid}")
    Case getById(@Param("cid") Long cid);

    int removeByIds(@Param("list") List list);

    int updateCaseById(@Param("case") Case C);

    int updateOneWayCase(@Param("case") Case aCase);

    int caseHandingTurnToCaseIsHandled(@Param("case") Case C);

    int changeStatus(@Param("case") Case c);

    int deleteOneWayCase(@Param("cid") long cid);

    Device selectDeviceId(@Param("cid") long cid);

    DeviceVo selectGeromeryId(@Param("did") long did);

    AcceptTestDdetails acceptTestDdetails(@Param("cid")Long cid);

    List<OneWayCaseNoHandVo> selectOtherTask(@Param("status") String status);

    CaseNoHandle mobileOtherTestDdetails(@Param("cid") Long cid);
}
